let { movieModel } = require("../Model");
// let mateFilmMock = require("../Mock/mateFilmMock.js");
// const { get } = require("../Model/addSchema");

// console.log(mateFilmMock);

// async function addMateFilm(){
//     let data = await movieModel.insertMany(mateFilmMock);

//     console.log(data);
// }
// addMateFilm()

async function getMateFilm(filter, page = 1, limit = 5, sort = "_id") {
    let data = await movieModel
                    .find(filter)
                    .skip((page - 1) * limit)
                    .limit(limit)
                    .sort(sort);
    return data;
}


module.exports.getMateFilm = getMateFilm;